include ../../../xxsq.mk

C_FILE = $(wildcard *.c)
CC_FILE = $(wildcard *.cc)

C_OBJ_FILE = $(patsubst %.c, %.o, $(C_FILE))
CC_OBJ_FILE = $(patsubst %.cc, %.o, $(CC_FILE))

OUT_FILE = ./json2pb.a

COMP_INC = $(ROLE_INC) $(CONFIG_INC) $(BASE_INC) $(PB_INC) $(PROTOC_INC) $(SKYNET_INC) $(MYSQL_INC)
COMP_LIB = $(ROLE_LIB) $(CONFIG_LIB) $(BASE_LIB) $(PB_LIB) $(PROTOC_LIB) -lpthread -lz

all:$(OUT_FILE)
$(OUT_FILE): $(C_OBJ_FILE) $(CC_OBJ_FILE)
	$(AR) rc $(OUT_FILE) $(C_OBJ_FILE) $(CC_OBJ_FILE)

%.o:%.cc
	$(CXX) $(C_ARGS) -fPIC -o $@ $(COMP_INC) -c $<


clean:
	rm -f $(OUT_FILE) $(C_OBJ_FILE) $(CC_OBJ_FILE)
	
